import axios from "axios";

const api = {
    antennaListApi: '/antenna/device/antennas/get', //获取天线列表
    antennaReadyApi: '/antenna/sifu/ready',  //伺服准备
    antennaSetSpeedApi: '/antenna/sifu/speed/set', //预置速度
    antennaCollectApi: '/antenna/sifu/collect', //收藏锁定
    antennaLocationApi: '/antenna/sifu/location/set', //位置设置
    antennaStepTrackApi: '/antenna/sifu/stepTrack', //步进跟踪
    antennaStopApi: '/antenna/sifu/stop', //紧急停车

    polarLocationApi: '/antenna/polar/location/set',  //极化位置
    polarManualApi: '/antenna/polar/manual/direction',  //极化手控
    polarSearchStateApi: '/antenna/polar/query',  //查询极化状态 get
    polarResetApi: '/antenna/polar/reset',  //故障复位
    polarSetSatelliteApi: '/antenna/polar/satellite/set', //预置卫星

    trackAfcApi: '/antenna/track/afc', //AFC调控
    trackSetFreqApi: '/antenna/track/freq',  //设置频率
    trackSearchStateApi: '/antenna/track/query',  //查询状态 get
    trackRemoteApi: '/antenna/track/remote', //远控/本控转换



    startCollectApi: '/config/start/collect',  //开始采集
    clearCountApi: '/config/reset/packet',  //清空计数
    clSwitchApi: '/config/config/channelStatus', //通道开关
    firstPageApi: '/config/get/channels', //进入工作参数页面
    setSubmitApi: '/config/config/channels', //参数提交
    channelChooseApi: '/config/look/channel', //通道选择
    diskSizeApi: '/config/get/diskSize', //获取磁盘占用
    saveSwitchApi: '/config/config/filePath', //存储开关及参数
    ipGetApi: '/config/get/Ip',   //获取ip
    ipSetApi: '/config/config/configIp',   //配置ip
    getNewStateApi: '/config/pull/channels',   //重新获取参数
    manualStepCalculate: '/antenna/sifu/manualStepCalculate',
    locationSet: '/antenna/sifu/location/set',
    satelliteCompute: '/antenna/sifu/satellite/compute',
    speedSet: '/antenna/sifu/speed/set',
    autoSearchAPI: '/antenna/sifu/autoSearch',
    manualDirectionAPI:'/antenna/polar/manual/direction'
}

//获取天线列表
export function antennaList() {
    return axios({
        url: api.antennaListApi,
        method: 'get'
    })
}

//伺服准备
export function antennaReady(data) {
    return axios({
        url: api.antennaReadyApi,
        method: 'post',
        data
    })
}

//预置速度
export function antennaSetSpeed(data) {
    return axios({
        url: api.antennaSetSpeedApi,
        method: 'post',
        data
    })
}

//收藏锁定
export function antennaCollect(data) {
    return axios({
        url: api.antennaCollectApi,
        method: 'post',
        data
    })
}

//位置设置
export function antennaLocation(data) {
    return axios({
        url: api.antennaLocationApi,
        method: 'post',
        data
    })
}

//步进跟踪
export function antennaStepTrack(data) {
    return axios({
        url: api.antennaStepTrackApi,
        method: 'post',
        data
    })
}

//紧急停车
export function antennaStop(data) {
    return axios({
        url: api.antennaStopApi,
        method: 'post',
        data
    })
}

//极化预置位置
export function polarLocation(data) {
    return axios({
        url: api.polarLocationApi,
        method: 'post',
        data
    })
}

//极化手控
export function polarManual(data) {
    return axios({
        url: api.polarManualApi,
        method: 'post',
        data
    })
}

//极化状态查询
export function polarSearchState() {
    return axios({
        url: api.polarSearchStateApi,
        method: 'get',
    })
}

//极化状态复位
export function polarReset(data) {
    return axios({
        url: api.polarResetApi,
        method: 'post',
        data
    })
}

//极化预置卫星
export function polarSetSatellite(data) {
    return axios({
        url: api.polarSetSatelliteApi,
        method: 'post',
        data
    })
}

//AFC调控
export function trackAfcApi(data) {
    return axios({
        url: api.trackAfcApi,
        method: 'post',
        data
    })
}

//跟踪接收机设置频率
export function trackSetFreq(data) {
    return axios({
        url: api.trackSetFreqApi,
        method: 'post',
        data
    })
}

//跟踪接收机查询
export function trackSearchState() {
    return axios({
        url: api.trackSearchStateApi,
        method: 'get',
    })
}

//远控本控切换
export function trackRemote(data) {
    return axios({
        url: api.trackRemoteApi,
        method: 'post',
        data
    })
}




//开始采集

export function startCollect(data) {
    return axios({
        url: api.startCollectApi,
        method: 'post',
        data
    })
}

//清空计数

export function clearCount() {
    return axios({
        url: api.clearCountApi,
        method: 'get'
    })
}

//通道开关
export function clSwitch(data) {
    return axios({
        url: api.clSwitchApi,
        method: 'post',
        data
    })
}


//工作参数页面

export function enterFirstPage() {
    return axios({
        url: api.firstPageApi,
        method: 'get'
    })
}

//通道设置页面

export function enterSecondPage() {
    return axios({
        url: api.secondPageApi,
        method: 'get'
    })
}

//参数提交

export function setSubmit(data) {
    return axios({
        url: api.setSubmitApi,
        method: 'post',
        data
    })
}

// 通道选择

export function channelChoose(data) {
    return axios({
        url: api.channelChooseApi,
        method: 'post',
        data
    })
}

//磁盘占用

export function diskSize() {
    return axios({
        url: api.diskSizeApi,
        method: 'get',
    })
}

//存储开关

export function saveSwitch(data) {
    return axios({
        url: api.saveSwitchApi,
        method: 'post',
        data
    })
}

//获取ip

export function ipGet() {
    return axios({
        url: api.ipGetApi,
        method: 'get',
    })
}

//配置ip

export function ipSet(data) {
    return axios({
        url: api.ipSetApi,
        method: 'post',
        data
    })
}


//获取新参数

export function getNewState() {
    return axios({
        url: api.getNewStateApi,
        method: 'get',
    })
}

//计算步长

export function calStep(data) {
    return axios({
        url: api.manualStepCalculate,
        method: 'post',
        data
    })
}

//方位俯仰调控

export function changeAntennaRange(data) {
    return axios({
        url: api.locationSet,
        method: 'post',
        data
    })
}

//卫星参数计算

export function satelliteCal(data) {
    return axios({
        url: api.satelliteCompute,
        method: 'post',
        data
    })
}

//卫星参数计算

export function speed(data) {
    return axios({
        url: api.speedSet,
        method: 'post',
        data
    })
}

//自动搜索

export function autoSearch(data) {
    return axios({
        url: api.autoSearchAPI,
        method: 'post',
        data
    })
}

// 获取设备信息
export function getDeviceInfo(params) {
    return axios({
        url: '/antenna/device/getByAntee/' + params,
        method: 'get',
    })
}


// 查询星历列表
export function getXingLiAPI(params) {
    return axios({
        url: '/antenna/sifu/xingli/get/' + params,
        method: 'get',
    })
}

// 导入csv
export function xingLiImportAPI(data, params) {
    return axios({
        url: '/antenna/sifu/xingli_file/upload',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: 'post',
        data,
        params
    })
}

// 一键删除星历数据
export function delXingLiAPI(data) {
    return axios({
        url: '/antenna/sifu/xingli/del',
        method: 'post',
        data
    })
}

// 引导星历数据
export function trackXingLiAPI(data) {
    return axios({
        url: '/antenna/sifu/xingliTrack/start',
        method: 'post',
        data
    })
}

// 停止引导星历数据
export function stopTrackXingLiAPI(data) {
    return axios({
        url: '/antenna/sifu/xingliTrack/stop',
        method: 'post',
        data
    })
}


// 查询星历引导状态
export function getXingLiStatusAPI(params) {
    return axios({
        url: '/antenna/sifu/xingliStatus/' + params,
        method: 'get',
    })
}


//极化控制 逆顺停210

export function manualDirection(data) {
    return axios({
        url: api.manualDirectionAPI,
        method: 'post',
        data
    })
}

//获取设备参数

export function getDeviceParamsAPI(params) {
    return axios({
        url: '/antenna/device/getByAntee/' + params,
        method: 'get',
    })
}

// 保存卫星参数
export function saveSatelliteInfoAPI(data) {
    return axios({
        url: '/antenna/satellite/saveSatelliteInfo',
        method: 'post',
        data
    })
}

// 查看保存过的卫星参数列表
export function lookSatelliteAPI(data) {
    return axios({
        url: '/antenna/satellite/lookSatellite',
        method: 'post',
        data
    })
}

// 任务列表查询接口
export function getTaskListAPI(data) {
    return axios({
        url: '/antenna/task/TaskList',
        method: 'post',
        data
    })
}

// 查看任务接口
export function lookTaskAPI(params) {
    return axios({
        url: '/antenna/task/lookTask/' + params,
        method: 'get',
        
    })
}

// 停止任务
export function stopTaskAPI(params) {
    return axios({
        url: '/antenna/task/TaskStop',
        method: 'post',
        params
    })
}

// 历史引导数据查询功能
export function getHistoryTrackingAPI(params) {
    return axios({
        url: '/antenna/sifu/HistoryTracking/query',
        method: 'get',
        params
    })
}

// 查询历史引导状态
export function getHistoryTrackStatusAPI(params) {
    return axios({
        url: '/antenna/sifu/historyStatus/' + params,
        method: 'get',
    })
}

// 开始引导历史数据
export function trackHistoryAPI(data) {
    return axios({
        url: '/antenna/sifu/HistoryTrack/start',
        method: 'post',
        data
    })
}


// 停止引导历史数据
export function stopTrackHistoryAPI(data) {
    return axios({
        url: '/antenna/sifu/historyTrack/stop',
        method: 'post',
        data
    })
}